﻿#pragma once

#include <QtWidgets/QMainWindow>
#include <QVTKOpenGLNativeWidget.h>
#include <pcl/point_types.h> 
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/visualization/cloud_viewer.h>

class VTKPCLAreaPick : public QMainWindow
{
	Q_OBJECT

public:
	VTKPCLAreaPick(QWidget* parent = nullptr);
	~VTKPCLAreaPick();

	pcl::visualization::PCLVisualizer::Ptr viewer;
	pcl::PointCloud<pcl::PointXYZ>::Ptr cloud;
	pcl::PointCloud<pcl::PointXYZ>::Ptr cloud2;
	pcl::PointCloud<pcl::PointXYZ>::Ptr cloudClick;
	bool isSelect = false;
private:
	static void AreaPickCallBack(const pcl::visualization::AreaPickingEvent& et, void* args);
	static void ClickPickCallBack(const pcl::visualization::PointPickingEvent& event, void* args);
	// 左键按下回调
	static void LeftButtonDownCallBack(const pcl::visualization::MouseEvent& et, void* args);
	static void KeyboardCallBack(const pcl::visualization::KeyboardEvent& et, void* args);

	QVTKOpenGLNativeWidget* vtkWidget;
};
